import { Form as AntForm, Input } from 'antd';
import { Message as M1 } from '../../api/admin/role/add.api';
import Textarea from '../../../components/textarea';

export default function Form({
	data,
	onChange
}: {
	data: M1;
	onChange(key: keyof M1, v: number | string): void;
}) {
	return <>
		<AntForm.Item required label="角色名称:">
			<Input placeholder='角色名称' value={data.name} onChange={(e) => {
				onChange('name', e.target.value);
			}} />
		</AntForm.Item>
		<AntForm.Item label="角色描述">
			<Textarea value={data.description} onChange={(v) => {
				onChange('description', v);
			}} />
		</AntForm.Item>
	</>;
}
